fix(web-shell): use renamed session-activity mock in split-view rerender test (#11409) - #11412
Conversation
…der test (#11409) Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
Autofix E2E Report — Issue #11409SummaryThe nightly release Root causeShard 2 ran a Web Shell unit test that could not execute in any environment: This is a semantic merge conflict, not a product bug:
The check-run annotations for the failed job show only GitHub's generic "Process completed with exit code 1" — consistent with FixOne test-only change in A mutation probe confirms the repaired test still guards the behavior: with Two other failure groups appear only in this sandbox and are not part of the CI failure: Verification
中文说明Autofix E2E 报告 — Issue #11409摘要每夜发布 根因分片 2 运行了一个在任何环境下都无法执行的 Web Shell 单元测试: 这是一次语义合并冲突,而非产品缺陷:
失败任务的 check-run 注解只有 GitHub 通用的 "Process completed with exit code 1"——这与 修复仅测试文件的一处修改: 变异测试(mutation probe)确认修复后的测试仍然守护原行为:临时修改 另外两组失败仅出现在本沙箱中,与本次 CI 失败无关: 验证
🧠 Handled by Qwen Code · model/模型 |
|
✅ Qwen Triage finished — CI landed green on ✅ Qwen Triage 已完成 —— |
|
Thanks for the PR! Template looks good ✓ Problem: observed, with a named failure — not hardening against a hypothetical. The nightly Direction: aligned. A test that cannot execute is failing the release gate, and repairing it is squarely in scope. There is no product surface here, so there is no upstream direction signal to weigh — I did not go looking for one. Size: not applicable. No core paths: one file under Approach: minimal, and as far as I can tell the only correct option. I pulled #11267's own diff ( The alternative — reinstating a mock under the old name — would be wrong, not merely larger: the Risk: no elevated risk signals. The high-risk path scan has nothing to match — the only changed file is filtered out as a One non-blocking observation, explicitly not for this PR: the reason this reached Moving on to code review. 🔍 中文说明感谢贡献! 模板完整 ✓ 问题: 已观测到的真实故障,有明确的失败记录——不是针对假想场景的加固。每夜版本 方向: 对齐。一个无法执行的测试正在让发布门禁失败,修复它完全在职责范围内。此处不涉及产品行为,因此没有需要权衡的上游方向信号——我也没有去硬找一个。 规模: 不适用。未触及核心路径:只有一个位于 方案: 改动最小,而且据我判断是唯一正确的选项。我拉取了 #11267 自身的 diff( 另一种做法——用旧名重新加一个 mock——不只是更大,而是错的: 风险: 无升级风险信号。高风险路径扫描没有可匹配项——唯一改动的文件作为 一条不阻塞的观察,且明确不属于本 PR 范围:这个问题能进入 进入代码审查 🔍 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
Code reviewNo critical blockers, and no AGENTS.md violations. Test-only, three lines, one symbol substituted — nothing unrelated rode along. What I actually spent the time on is whether the replacement mock is the same sensor, since a rename that quietly changes what a test measures is worse than a test that fails loudly. My own baseline before judging the diff: for a test referencing a symbol a rename deleted, the options are (a) repoint the references at the surviving equivalent, (b) re-add a mock under the old name, (c) replace the sensor with an explicit render counter, or (d) drop the test. (b) is wrong here, (c) and (d) throw away or duplicate working machinery, so (a) is what I'd have done — and it is what the PR did. I then verified the premises of (a) rather than assuming them:
Net: the repaired test measures the same thing it was written to measure, and it is not vacuous — its own positive assertion at line 28940 fails loudly if the sensor ever stops firing, so a silently-dead sensor cannot pass. Test evidenceThis is an unattended CI run ( The lane that matters here does cover the change: At the time of writing there are no failures: 9 checks succeeded, 13 skipped, 5 still running — including Final CI results for
One row per check name (latest run); skipped checks omitted; failures sort first. / 每个检查名一行(取最新一次运行),省略 skipped,失败项排在最前。 Sandboxed verification would settle the one thing a green suite cannot: Real-scenario tmux testing: N/A — unattended CI run, and nothing user-visible: the diff touches no product code, so there is no terminal surface to drive. 中文说明代码审查没有阻塞性问题,也没有违反 AGENTS.md 的地方。仅测试改动、三行、替换一个符号——没有夹带无关内容。 我真正花时间核实的是"替换后的 mock 是否是同一个探针",因为一次悄悄改变测试度量对象的重命名,比一个大声失败的测试更糟。在看 diff 之前我自己的判断基线是:对于引用了被重命名删除的符号的测试,可选方案有 (a) 把引用指向存活的等价符号、(b) 用旧名重新加一个 mock、(c) 换成显式的渲染计数器、(d) 删掉测试。这里 (b) 是错的,(c) 和 (d) 要么丢弃要么重复已有的可用机制,所以我会选 (a)——而 PR 正是这么做的。 随后我核实了 (a) 成立的各个前提,而不是想当然:
结论:修复后的测试度量的仍是它原本要度量的东西,而且不是空测试——它在 28940 行的正向断言会在探针失效时大声失败,所以一个悄悄死掉的探针不可能通过。 测试证据本次为无人值守 CI 运行( 这里关键的通道确实覆盖了本次改动: 截至撰写时没有任何失败:9 项通过、13 项跳过、5 项仍在运行——其中包括 (CI 表格见上方英文部分,未重复粘贴。) 沙箱验证可以解决绿色套件无法解决的那一点: 真实场景 tmux 测试:N/A —— 本次为无人值守 CI 运行,且没有用户可见改动:diff 不涉及任何产品代码,因此没有可驱动的终端界面。 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
|
Confidence: 5/5 — clean at every stage; the only thing between this and merge is CI landing, which the deferred approval below handles. Stepping back: this is the easy case that still deserves the hard look, because "obvious three-line test fix" is exactly where a silently-wrong repair sails through. The failure mode that matters for a rename repair is not "does it compile" — it is "does the test still measure what it claims to measure". I went looking for that specifically and it isn't present: the substituted mock is wired to the hook App calls on every render, nothing else in the suite can reach it, it is reset before each test, and the test's own positive assertion would fail loudly if the sensor ever went dead. So the repaired test is neither vacuous nor measuring something new. The part I'd normally expect to go unchecked, and which turned out to be the interesting one: re-adding a mock under the old name — the "restore what was deleted" instinct — would have been affirmatively wrong here, not just larger, because the module mock no longer exports that hook name at all. Pulling #11267's diff settled it. That commit renamed this same symbol in five other places in this very file; these three lines arrived five hours later via #11250, which is why they were missed. The PR is the same rename completed, nothing more. Everything in the diff is necessary: there are exactly three occurrences of the dead symbol in the entire repository and the PR changes exactly those three. No drive-by edits, no formatting churn, no scope creep. In six months this reads as a test that names the hook the code actually uses — I'd thank the author, not curse them. Two honest caveats, neither blocking:
On the gate's usual skepticism: I checked whether I was being worn down or being a pushover, and neither applies — this is one PR against one named failing release run (#11409), from the repo's own autofix pipeline, and I verified the problem exists myself instead of accepting the framing. A repo-wide search for the dead symbol returning three hits, all of them the changed lines, is about as direct as evidence gets. What this PR deliberately does not do is prevent the next one: required checks ran green on #11250's pre-merge head while a rename landed on main underneath it, so the combined tree was never validated before the nightly hit it. That is a real recurring exposure and the description is right to scope it out of a release-unblocking fix — but it should not be dropped. A separate issue on post-merge or merge-queue validation is worth opening, and I've flagged it in the Stage 1 comment. Approval is deferred until CI lands green on 中文说明Confidence: 5/5 —— 各阶段均无问题;距离合并只差 CI 跑完,这由下方的延迟审批处理。 退一步看:这是那种看起来简单、但仍然值得认真看的案例,因为"显而易见的三行测试修复"正是一个悄悄错误的修复最容易蒙混过关的地方。重命名类修复真正要防的失败模式不是"能不能编译",而是"这个测试是否仍在度量它声称度量的东西"。我专门去找了这一点,它不存在:被替换的 mock 接线到 App 每次渲染都会调用的钩子,套件中没有别的东西能触达它,它在每个测试前被重置,而且测试自身的正向断言会在探针失效时大声失败。所以修复后的测试既不是空测试,也没有在度量新的东西。 通常最可能被漏掉、而这次恰恰最有意思的一点是:用旧名重新加一个 mock——那种"把被删掉的东西恢复回来"的直觉——在这里是明确错误的,而不只是改动更大,因为模块 mock 已经完全不导出那个钩子名了。拉取 #11267 的 diff 确认了这一点。该提交在同一个文件里另外五处也改了同一个符号;而这三行是五小时后随 #11250 才进来的,所以被漏掉了。本 PR 就是把同一次重命名补齐,仅此而已。 diff 中每一处改动都是必要的:整个仓库里那个失效符号恰好只有三处出现,PR 改的正是这三处。没有顺手改动,没有格式化噪音,没有范围蔓延。六个月后回看,这就是一个"测试名字与代码实际使用的钩子一致"的状态——我会感谢作者,而不是骂他。 两点如实说明,均不阻塞:
关于门禁惯常的怀疑态度:我检查了自己是否被消耗、或是否在做老好人,两者都不成立——这是针对一个具名失败发布运行(#11409)的单个 PR,来自本仓库自己的 autofix 流水线,而且我是自己核实了问题确实存在,而不是接受它的叙述框架。全仓搜索那个失效符号返回三处命中、且全部是被改动的行,这已经是相当直接的证据了。 本 PR 有意没有做的事,是防止下一次同类问题:必需检查在 #11250 合并前的 head 上是绿的,而一次重命名在其下方合入了 main,所以合并后的代码树在每夜发布撞上之前从未被验证过。这是一个真实且会复发的暴露面,描述把它划出一个"解阻发布"的修复之外是正确的——但不应该就此丢掉。另开一个关于合并后校验或 merge queue 的 issue 是值得的,我已在 Stage 1 评论中提出。 审批延迟至 CI 在 — Qwen Code · qwen3.8-max-2026-09-02 Reviewed at |
🖼️ web-shell visual previewRendered against a mock daemon (no real backend): the PR base vs this PR head Screenshots · before / afterFull-resolution recordings (.webm) are attached to the workflow run. — Qwen Code · web-shell visuals |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship — CI landed green after the review. ✅
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
Partially reviewed — gaps disclosed.
Not explored to full depth (tool budget reached): "agent 6c": mutation run of the *unmodified* test with rerender() removed, to confirm whether the loop negatives alone already catch that drop (I only ran that mutation o…; "agent 6c": npm run typecheck and npm run lint for packages/web-shell at HEAD — correctness was checked by grep over the repo plus the full vitest run of App.test.ts…; "agent 4": none — I did not run the full App.test.tsx suite (only the two filtered cases), since the other 794 tests are outside this diff and the file's whole-suite run….
Not reviewed: reverse audit — stopped before round 1 by the review time budget.
中文说明
仅完成部分审查,审查缺口已披露。
未探索到全部深度(达到工具调用预算):"agent 6c":mutation run of the *unmodified* test with rerender() removed, to confirm whether the loop negatives alone already catch that drop (I only ran that mutation o…;"agent 6c":npm run typecheck and npm run lint for packages/web-shell at HEAD — correctness was checked by grep over the repo plus the full vitest run of App.test.ts…;"agent 4":none — I did not run the full App.test.tsx suite (only the two filtered cases), since the other 794 tests are outside this diff and the file's whole-suite run…。
未审查:反向审计——评审时间预算不足,未能开始第 1 轮。
— qwen3.8-max via Qwen Code /review (v0.23.1)
|
🤖 Reviewed the latest feedback — no changes needed. Why, point by point: · 已审阅最新反馈——无需改动。逐点说明原因如下: Autofix round — no action requiredAll feedback on this round was triaged; nothing required a code change. Feedback triage
Repository state
No commit was made; the branch is unchanged. 中文说明Autofix 本轮处理 —— 无需改动本轮所有反馈均已分类处理,没有需要进行代码修改的事项。 反馈分类
仓库状态
本轮未提交任何提交;分支保持不变。 Base-conflict check · 基分支冲突检查: no conflict with main. · 与 main 无冲突。 🧠 Handled by Qwen Code · model/模型 |
Maintainer verification — real local environmentI built a real environment for this PR and ran it: a dedicated worktree at the PR head Verdict: the change itself is correct, but merging it now is a no-op — please close it as superseded by #11406 rather than merging.
1. The break reproduces exactly, and the fix clears itOn the nightly tree The PR's own full-suite claim holds, and it closes a caveat the PR could not: the full web-shell suite on the pre-fix tree is 2. This PR's version is strictly weaker than what
|
Follow-up: merged — nothing to undo, and one correction to my comment aboveThis landed as
Correction to my comment above. I wrote that The one item still worth acting on is unrelated to this PR: the post-merge push lane went red on 中文版后续:已合入 —— 无需回滚,另更正上一条评论中的一处事实本 PR 在上面的验证仍在进行时以
更正上一条评论。 我写道 唯一仍值得处理的一项与本 PR 无关:合并后的 push 通道在 18:36:28Z 就在 |
|
Released in v0.23.2. |








What this PR does
This PR repairs one Web Shell unit test in the split-view session navigation suite. The test that pins "App must not rerender when the split view reports pending panes belonging to other sessions" referenced a mock variable that no longer exists on main, so the test aborted with a
ReferenceErrorbefore making any assertion. The three offending lines now use the existing, correctly named session-activity mock — the same App-render sensor the test intended, under its current name.Why it's needed
The nightly release
v0.23.1-nightly.20260908.1f890086f1failed (#11409): the release workflow's Workspace Tests (2/3) lane ran this test and exited non-zero, which failed the aggregated Quality Checks gate and blocked the release. The break is a semantic merge conflict: #11267 renamed the App-level prompt-state hook (and its test mock) on main while #11250 was open; #11250's CI was green on its own head, and its squash merge combined textually but left its new test block referencing the deleted name. The nightly was the first release validation to execute the combined tree.Reviewer Test Plan
How to verify
Confirm the test now runs and still guards the intended behavior:
cd packages/web-shell && npx vitest run client/App.test.tsx -t "does not rerender App for other split sessions"— bothouter pendingvariants should pass (they previously failed withReferenceError: mockUseDaemonActivePromptBridge is not defined).cd packages/web-shell && npx vitest run --config vitest.config.ts— 288 files / 6712 tests pass.VITEST_RETRY=2 NO_COLOR=true .github/scripts/run-release-workspace-tests.sh 2— all workspaces green, exit code 0 (previously the web-shell workspace failed this lane).Evidence (Before & After)
N/A — test-only change, no user-visible behavior. Before: the two test variants fail with
ReferenceErrorin any environment. After: they pass and still detect App rerenders triggered by other sessions' split panes.Tested on
Environment (optional)
N/A — unit tests only (Vitest, Node 22).
Risk & Scope
Linked Issues
Fixes #11409
中文说明
本 PR 做了什么
本 PR 修复了 split-view 会话导航套件中的一个 Web Shell 单元测试。该测试用于固定"当 split view 上报属于其他会话的 pending 面板时,App 不得重渲染"这一行为,但它引用了一个在 main 上已不存在的 mock 变量,导致测试在进行任何断言之前就以
ReferenceError中止。涉事的三行现在改用现有的、命名正确的会话活跃度 mock——这正是测试原本想要的 App 渲染探针,只是采用了它现在的名字。为什么需要
每夜发布
v0.23.1-nightly.20260908.1f890086f1失败(#11409):发布工作流的 Workspace Tests (2/3) 分片运行了该测试并以非零状态退出,导致聚合的 Quality Checks 门禁失败,阻塞了发布。这次破坏是一次语义合并冲突:#11267 在 #11250 仍处于打开状态时在 main 上重命名了 App 层的 prompt 状态钩子(及其测试 mock);#11250 的 CI 在它自己的 head 上是绿色的,而它的压缩合并在文本层面合并成功,却让它新增的测试块继续引用已被删除的名称。每夜发布是第一个执行合并后代码树的发布验证。评审者测试计划
如何验证
确认该测试现在可以运行、并且仍然守护预期行为:
cd packages/web-shell && npx vitest run client/App.test.tsx -t "does not rerender App for other split sessions"—— 两个outer pending变体都应通过(此前它们以ReferenceError: mockUseDaemonActivePromptBridge is not defined失败)。cd packages/web-shell && npx vitest run --config vitest.config.ts—— 288 个文件 / 6712 个测试通过。VITEST_RETRY=2 NO_COLOR=true .github/scripts/run-release-workspace-tests.sh 2—— 所有工作区全绿,退出码 0(此前 web-shell 工作区在此通道失败)。前后对比证据
N/A —— 仅测试修改,无用户可见行为。修复前:两个测试变体在任何环境下都以
ReferenceError失败。修复后:它们通过,并且仍能检测由其他会话的 split 面板触发的 App 重渲染。已测试平台
环境(可选)
N/A —— 仅单元测试(Vitest,Node 22)。
风险与范围
关联 Issue
Fixes #11409